New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@guardian/src-foundations

Package Overview
Dependencies
Maintainers
22
Versions
168
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guardian/src-foundations

The Guardian's design tokens are the atoms from which all our visual design is built. They are intended for use with a CSS-in-JS library such as Emotion.

  • 0.2.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
172
increased by29.32%
Maintainers
22
Weekly downloads
 
Created
Source

Foundations

The Guardian's design tokens are the atoms from which all our visual design is built. They are intended for use with a CSS-in-JS library such as Emotion.

Install

$ yarn add @guardian/src-foundations

Use

Palette

import { palette } from "@guardian/src-foundations"

const backgroundColor = css`
    background-color: ${palette.neutral[97]};
`

Media queries

DEPRECATED! Please import media queries from @guardian/src-utilities

import { mobileLandscape, from, until } from "@guardian/src-foundations"

const styles = css`
    padding: 0 10px;

    ${mobileLandscape} {
        padding: 0 20px;
    }

    ${from.phablet.until.desktop} {
        padding: 0 32px;
    }

    ${until.wide} {
        padding: 0 40px;
    }
`

Output:

.class-name {
    padding: 0 10px;
}

@media (min-width: 480px) {
    .class-name {
        padding: 0 20px;
    }
}

@media (min-width: 660px) and (max-width: 980px) {
    .class-name {
        padding: 0 32px;
    }
}

@media (max-width: 1300px) {
    .class-name {
        padding: 0 40px;
    }
}

Visually Hidden

DEPRECATED! Please import visuallyHidden from @guardian/src-utilities

For elements that should not appear to sighted users, but are useful to assistive technology users.

import { visuallyHidden } from "@guardian/src-foundations"

const label = css`
    ${visuallyHidden};
`

Focus Halo

DEPRECATED! Please import focusHalo from @guardian/src-utilities

This mixin provides a clear focus state for elements that may receive keyboard focus.

import { focusHalo } from "@guardian/src-foundations"

const input = css`
    ${focusHalo};
    width: 200px;
    height: 44px;
`

FAQs

Package last updated on 25 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc